//
//  MessageTableViewCell.m
//  ShouYi
//
//  Created by yrapp on 16/2/23.
//  Copyright © 2016年 yurui. All rights reserved.
//

#import "MessageTableViewCell.h"

@implementation MessageTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
 
        self.contentView.backgroundColor = [UIColor colorWithRed:235.0/255 green:235.0/255 blue:235.0/255 alpha:1];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kWidth, 100)];
        backView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:backView];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 150, 20)];
        _titleLabel.text = @"来自公交车的故事";
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:15];
        [self.contentView addSubview:_titleLabel];
        
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, _titleLabel.frame.size.height + 10, 150, 20)];
        _timeLabel.text = @"今天 12:00 来源: 小记者";
        _timeLabel.textColor = [UIColor grayColor];
        _timeLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_timeLabel];
        
        _detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, _timeLabel.frame.origin.y + _timeLabel.frame.size.height + 5, kWidth * 2 / 3, 30)];
        _detailLabel.numberOfLines = 0;
        _detailLabel.font = [UIFont systemFontOfSize:12];
        _detailLabel.textColor = [UIColor grayColor];
        _detailLabel.text = @"两名自称是某杂志社的孩子说,他们在公交车上给以为六十多的老大妈让了座位,还被老大妈打了一顿";
        [self.contentView addSubview:_detailLabel];
        
        _messageImageView = [[UIImageView alloc] initWithFrame:CGRectMake(kWidth - 90, 20, 80, 60)];
        _messageImageView.image = [UIImage imageNamed:@"img_xxxx.jpg"];
        [self.contentView addSubview:_messageImageView];
        
    }
    
    return self;
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
